package leetcode;

public class 素数个数 {
    // 暴力法
    public  static boolean isPrime(int a) {
        for (int i = 2; i <a; i++) {
            if (a%i==0) {
                return false;
            }
        }
        return true;
    }
    public  static int primeNum(int a) {
        int total = 1;
        for (int i = 3; i <=a; i++) {
            if (isPrime(i)) {
                total++;
            }
        }
        return total;
    }
    //
    public static void main(String[] args) {
        System.out.println(primeNum(10));
    }
}
